package mess;

import java.sql.SQLOutput;
import java.util.Arrays;

public class LeeCode_2341 {
    public static void main(String[] args) {
        int[] nums = new int[]{0};
        System.out.println(Arrays.toString(numberOfPairs(nums)));
    }

    private static int[] numberOfPairs(int[] nums) {
        Arrays.sort(nums);
        int count1 = 0;
        int count2 = nums.length;
        for (int i = 0; i < nums.length - 1; i++) {
            if (nums[i] == nums[i + 1]) {
                count1++;
                count2 -= 2;
                i++;
            }
        }
        return new int[]{count1, count2};
    }
}
